import { request } from "../../utils/request";
const isD = import.meta.env.MODE === 'development'
    ? ''
    : ''

// 获取用户列表  v1 get
// export function user(data: any) {
//     return request({
//         url: `${isD}/dpl/v1/admin/user`,
//         method: "get",
//         params: data,
//     });
// }

// 获取用户列表 v2 post
export function getUser(data: any) {
    return request({
        url: `${isD}/dpl/v2/admin/user/list`,
        method: "post",
        data,
    });
}
// 删除
export function userDel(data: any) {
    return request({
        url: `${isD}/dpl/v1/admin/user/${data}`,
        method: "delete",
        // params: data,
    });
}
// 新增用户
export function userAdd(data: any) {
    return request({
        method: "post",
        url: `${isD}/dpl/v1/admin/user`,
        data,
    });
}
// 更新
export function userEdit(data: any) {
    return request({
        method: "put",
        url: `${isD}/dpl/v1/admin/user`,
        data,
    });
}

// 获取管理员
export function auth(data: any) {
    return request({
        url: `${isD}/dpl/v1/admin/auth`,
        method: "get",
        params: data,
    });
}
// 删除普通管理员
export function authDel(data: any) {
    return request({
        url: `${isD}/dpl/v1/admin/auth/${data}`,
        method: "delete",
        // params: data,
    });
}
// 新增管理员
export function authAdd(data: any) {
    return request({
        method: "post",
        url: `${isD}/dpl/v1/admin/auth`,
        data,
    });
}
// 更新产品
export function authEdit(data: any) {
    return request({
        method: "put",
        url: `${isD}/dpl/v1/admin/auth`,
        data,
    });
}
// 重置密码
export function resetPassword(data: any) {
    return request({
        method: "put",
        url: `${isD}/dpl/v1/admin/auth/resetPassword`,
        data,
    });
}